<?php
/**
 * 当前登录用户产品列表
 */
namespace Api\Controller;

use Think\Controller;

class ProductsController extends Controller {

	public function _initialize() {
	    $this->m_sale_good = D("Sale/SaleGood");
	}

    public function entry() {
	    $sale_id = I("post.sale_id");
	    // $sale_id = 18;

        $where = array("sale_id"=>$sale_id);

    	$result = $this->m_sale_good->where($where)->select();

    	$list = array();
    	foreach ($result as $_key => $_row) {
    		$list[] = array(
    			'good_id'=>$_row['id'],
    			'goods_name'=>$_row['good_name'].'-'.$_row['vip_good_unit_price'].'元/'.$_row['good_unit'],
    		);
    	}

    	exit(json_return('1','',array('list'=>$list,'count'=>count($list))));
    }
}

